package exercise;
import com.ynny.chapter01.User;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class UserTset {
    @Test
   public void  userTest(){
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("User.xml");
        User user1 = (User) context.getBean("user1");
        user1.setId(1);
        user1.setName("张三");
        user1.show();
    }
    @Test
    public void  userTest2(){
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("User.xml");
        User user1 = (User) context.getBean("user2");
        user1.setId(2);
        user1.setName("李四");
        user1.show();
    }
}
